package com.tian.utils;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * @author tianwc  公众号：java后端技术全栈、面试专栏
 * @version 1.0.0
 * @date 2023年09月06日 16:41
 * 在线刷题 1200+题和1000+篇干货文章：<a href="https://woaijava.cc/">博客地址</a>
 */
public class Test1 {
    public static void main(String[] args) {
        String[] strings = {"aa", "bb", "cc", "dd", "ee"};
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.addAll(Arrays.asList(strings));
        //0,1,2,3,4
        //
//        for (int i = 0; i < arrayList.size(); i++) {
        for (int i = 0; i < 5; i++) {
            arrayList.remove(i);
        }
        System.out.println(arrayList.size());

        for (String s : arrayList) {
            System.out.println(s);
        }
    }
}
